<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

		<title>websocket在线测试</title>
		<meta content="WebSocket 在线测试 工具" name="description">
		<meta content="WebSocket 在线测试 工具" name="keywords">
		<link rel="stylesheet" href="./res/index.css">
		<link rel="stylesheet" href="./res/bootstrap.min.css">

		<script>
			function GetQueryString(name) {
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
				var r = window.location.search.substr(1).match(reg);
				if(r != null) return unescape(r[2]);
				return null;
			}
		</script>

	</head>

	<body mycollectionplug="bind" youdao="bind">
		<div class="page-header">
			<h1 style="margin-top:-20px;margin-left:20px;">WebSocket 在线测试 v13 <small>by 煌</small></h1>

		</div>
		<div>
			<div class="zone_conn">
				<input type="text" class="form-control" style="float:left;" id="inp_url" value="ws://123.232.98.202:9008" placeholder="连接的地址">
				<button type="button" id="btn_conn" class="btn btn-primary" style="float:left;margin-left:10px;margin-right:10px;" onclick="fun_initWebSocket();">连接</button>
				<button type="button" id="btn_close" class="btn btn-danger" style="float:left;" disabled="disabled" onclick="fun_close();">断开</button>
			</div>
			<div class="clearboth">
				连接格式为 ws://IP:端口（示例ws://123.232.98.202:9008）<br> 对于
				<span style="color:red">内网</span>的测试环境，只需填入服务端的<span style="color:red">内网</span>IP和端口。
			</div>
			<div class="zone_send">
				<a id="emoji" style="position:relative;left:374px;bottom:5px;cursor:pointer;" data-toggle="popover" title="" data-original-title="表情"><img style="outline-width:40px;" src="./diocp-websocket_files/huanglianwx_thumb.gif">表情</a>
				<textarea id="inp_send" class="form-control" style="height:154px;" placeholder="发送的内容"></textarea>
				<br>
				<button type="button" id="btn_send" class="btn btn-default" onclick="fun_sendto();">发送（ctrl+回车）</button>
				<div style="margin-top:20px;color:red;">请使用Chorme浏览器进行测试</div>
				<div style="color:blue;font-weight:900">网页端作者QQ：114687576</div>
				<div style="color:blue;font-weight:900">服务端diocp群：DIOCP(Delphi iocp) 320641073</div>

			</div>
		</div>
		<div style="position:absolute;top:100px;left:470px;">
			<div id="div_msgzone" class="panel panel-default">
				<div class="panel-heading">消息窗口</div>
				<div id="div_msg" class="panel-body" style="width: 1180px; height: 736px;"></div>
			</div>
		</div>
		<script type="text/javascript" src="./res/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="./res/bootstrap.min.js"></script>
		<script type="text/javascript" src="./res/index.js"></script>

		<script>
			$(function() {
				var wshost=GetQueryString("host");
				if (wshost!=null)
				{
					$("#inp_url").val(wshost);
					console.log(wshost);					
				}
			});
		</script>
	</body>

</html>